package com.chennan.book.api.rest.servicecontroller.dto;

import lombok.Data;

import java.io.Serializable;

/**
 * @author chennan
 * @create 2022-01
 */
@Data
public class ExecutePlan implements Serializable {

    private int sumThreadCount;

    private Long sumCount;

    private Long currntCount;

    private Double percent;
    private String percentName;

    private Integer runThreadCount;

    public Double getPercent(){
        return (currntCount/(sumCount*1.0))*100;
    }

    public String getPercentName() {
        if (currntCount == null || sumCount == null) {
            return 0 + "%";
        }
        return ((currntCount / (1.0 * sumCount))*100) + "%";
    }
}
